<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="mcfn" uri="mcfn" %>
<%@taglib prefix="fn" uri="jstl-fn" %>
					<div id="bodyContent">
						<h1>Assets</h1>
						<div class='errors'><html:errors/>${UserLogin.messageError}</div><br/>
<c:if test="${UserLogin.actualRoleId eq 2}">
						<div style="text-align: right; width: 100%;">
						<span style="display: inline;" class="contentBtn"><a href="AssetsAlta.do"><img src="${URLBase}images/btnAdd.gif" /></a></span> &nbsp; 
						<span style="display: inline;" class="contentBtn"><a href="${URLBase}PreimplementacionEvento.do"><img src="images/btnPreimplementacion.gif" /></a></span>
						</div>
</c:if>
						<br/>
<c:set value="${fn:length(Assets)}" var="AssetsLength" />
<c:choose>
<c:when test="${AssetsLength eq 0}">
						<center>No records</center>
</c:when>
<c:otherwise>
						<table class="tabDatos">
							<thead>
								<tr>
									<th>Name</th>
									<th>Category</th>
									<th>Subcategory</th>
									<th>Event Date</th>
									<th></th>
								</tr>
							</thead>
<!--<c:forEach items="${Assets}" var="asset" varStatus="assetStatus"> 
    
							<tr onmouseover="this.style.background='lightgray';" onmouseout="this.style.background='white';">
								<td onclick="javascript: document.getElementById('FormEditar-${asset.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${asset.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${asset.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${asset.tblSubcateg.tblCategoria.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${asset.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${asset.tblSubcateg.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${asset.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${mcfn:formatDate(asset.fecha,'dd/MM/yyyy')}</td>
								<td align="right">
									<table border='0'>
										<tr>
											<td>
												<html:form action='/AssetsDetalle' method='post' styleId="FormEditar-${asset.cveAsset}">
													<html:hidden property="cveAsset" value="${asset.cveAsset}"/>
													<html:image src="images/btnDetalle.gif" title="Detalle" />
												</html:form>
											</td>
<c:if test="${UserLogin.actualRoleId eq 2}">
											<td>
												<html:form action='/AssetsModificarPaquetes' method='post'>
													<html:hidden property="cveAsset" value="${asset.cveAsset}"/>
													<html:image src="images/btnPaquetes.gif" title="Paquetes" />
												</html:form>
											</td>
											<td>
												<html:form action='/AssetsBorrar' method='post'>
													<html:hidden property="cveAsset" value="${asset.cveAsset}"/>
													<html:image src="images/btnEliminar.gif" title="Borrar" onclick="if( confirm( 'Seguro que quieres borrar el asset con el nombre\n[${asset.nombre}]' ) ) return true ; else return false ;"/>
												</html:form>
											</td>
											<td>
												<html:form action='/AssetsEditar' method='post'>
													<html:hidden property="cveAsset" value="${asset.cveAsset}"/>
													<html:image src="images/btnEdit.gif" title="Editar" />
												</html:form>
											</td>
</c:if>
										</tr>
									</table>
									
								</td>
							</tr>
</c:forEach>-->
            
<c:forEach items="${postAssets}" var="assett" varStatus="assetStatuss"> 
    
							<tr onmouseover="this.style.background='lightgray';" onmouseout="this.style.background='white';">
								<td onclick="javascript: document.getElementById('FormEditar-${assett.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${assett.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${assett.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${assett.tblSubcateg.tblCategoria.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${assett.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${assett.tblSubcateg.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${assett.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${mcfn:formatDate(assett.fecha,'dd/MM/yyyy')}</td>
								<td align="right">
									<table border='0'>
										<tr>
                                                                                        <td>
												<html:form action='/AssetsMateriales' method='post'>
													<html:hidden property="cveAsset" value="${assett.cveAsset}"/>
													<html:image src="images/btnMateriales.gif" title="Detalle" />
												</html:form>
											</td>
											<td>
												<html:form action='/AssetsDetalle' method='post' styleId="FormEditar-${assett.cveAsset}">
													<html:hidden property="cveAsset" value="${assett.cveAsset}"/>
													<html:image src="images/btnDetalle.gif" title="Detalle" />
												</html:form>
											</td>
<c:if test="${UserLogin.actualRoleId eq 2}">
											<td>
												<html:form action='/AssetsModificarPaquetes' method='post'>
													<html:hidden property="cveAsset" value="${assett.cveAsset}"/>
													<html:image src="images/btnPaquetes.gif" title="Paquetes" />
												</html:form>
											</td>
<c:if test="${asset.numDiasViaje eq 1}">
    <td colspan="2">&nbsp;</td>
</c:if>
<c:if test="${asset.numDiasViaje eq 0}">
                                                                                        <td>
												<html:form action='/AssetsBorrar' method='post'>
													<html:hidden property="cveAsset" value="${assett.cveAsset}"/>
													<html:image src="images/btnEliminar.gif" title="Borrar" onclick="if( confirm( 'Seguro que quieres borrar el asset con el nombre\n[${assett.nombre}]' ) ) return true ; else return false ;"/>
												</html:form>
											</td>
											<td>
												<html:form action='/AssetsEditar' method='post'>
													<html:hidden property="cveAsset" value="${assett.cveAsset}"/>
													<html:image src="images/btnEdit.gif" title="Editar" />
												</html:form>
											</td>
</c:if>
											
</c:if>
										</tr>
									</table>
									
								</td>
							</tr>
</c:forEach>
                                                                                                        
<c:forEach items="${antAssets}" var="Aasset" varStatus="AassetStatus"> 
    
							<tr onmouseout="this.style.background='lightgray';" onmouseover="this.style.background='white';">
								<td onclick="javascript: document.getElementById('FormEditar-${Aasset.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${Aasset.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${Aasset.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${Aasset.tblSubcateg.tblCategoria.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${Aasset.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${Aasset.tblSubcateg.nombre}</td>
								<td onclick="javascript: document.getElementById('FormEditar-${Aasset.cveAsset}').submit( );" onmouseover="javascript: this.style.cursor='pointer';" onmouseover="javascript: this.style.cursor='default';">${mcfn:formatDate(Aasset.fecha,'dd/MM/yyyy')}</td>
								<td align="right">
									<table border='0'>
										<tr>
                                                                                        <td>
												<html:form action='/AssetsMateriales' method='post' >
													<html:hidden property="cveAsset" value="${Aasset.cveAsset}"/>
													<html:image src="images/btnMateriales.gif" title="Materiales" />
												</html:form>
											</td>
											<td>
												<html:form action='/AssetsDetalle' method='post' styleId="FormEditar-${Aasset.cveAsset}">
													<html:hidden property="cveAsset" value="${Aasset.cveAsset}"/>
													<html:image src="images/btnDetalle.gif" title="Detalle" />
												</html:form>
											</td>
<c:if test="${UserLogin.actualRoleId eq 2}">
											<td>
												<html:form action='/AssetsModificarPaquetes' method='post'>
													<html:hidden property="cveAsset" value="${Aasset.cveAsset}"/>
													<html:image src="images/btnPaquetes.gif" title="Paquetes" />
												</html:form>
											</td>
<c:if test="${Aasset.numDiasViaje eq 1}">
    <td colspan="2">&nbsp;</td>
</c:if>
<c:if test="${Aasset.numDiasViaje eq 0}">
                                                                                        <td>
												<html:form action='/AssetsBorrar' method='post'>
													<html:hidden property="cveAsset" value="${Aasset.cveAsset}"/>
													<html:image src="images/btnEliminar.gif" title="Borrar" onclick="if( confirm( 'Seguro que quieres borrar el asset con el nombre\n[${Aasset.nombre}]' ) ) return true ; else return false ;"/>
												</html:form>
											</td>
											<td>
												<html:form action='/AssetsEditar' method='post'>
													<html:hidden property="cveAsset" value="${Aasset.cveAsset}"/>
													<html:image src="images/btnEdit.gif" title="Editar" />
												</html:form>
											</td>
</c:if>
											
</c:if>
										</tr>
									</table>
									
								</td>
							</tr>
</c:forEach>
                                                                                                        
						</table>
</c:otherwise>
</c:choose>
					</div>
					<div id="footContent"></div>
